<?php
/* @var $this QuotationOrderHeaderController */
/* @var $model QuotationOrderHeader */

$this->breadcrumbs=array(
	'Quotation Order Headers'=>array('index'),
	$model->quotation_no=>array('view', 'id'=>$model->detail_id),
	'Update',
);

Yii::app()->clientScript->registerScript('search', "
function formatNumber (num) {
    return num.toFixed(2).replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,');
}

function getVal(){
    var qty=document.getElementById('qty').value;
    qty=Number(qty.replace(/[^0-9\.-]+/g,''));
    var unit=document.getElementById('unit_sell').value;
    unit=Number(unit.replace(/[^0-9\.-]+/g,''));
    $('#unit_sell_hidden').val(unit);

    return formatNumber(unit*qty);
}

$('#qty').change(function(){
    var total=getVal();
    $('#total').val(total);
    
});

$('#unit_sell').change(function(){
    var total=getVal();
    $('#total').val(total);
});

");

$this->menu=array(
	array('label'=>'List Quotation', 'url'=>array('quotationOrderHeader/index')),
	array('label'=>'View Quotation', 'url'=>array('quotationOrderHeader/viewQuotationOrderHeader','id'=>$model->quotation_no)),
	//array('label'=>'Add Item', 'url'=>array('create','quo_no'=>$model->quotation_no)),
	array('label'=>'View Item', 'url'=>array('view',  'id'=>$model->detail_id)),
	array('label'=>'Delete Item', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete', 'id'=>$model->detail_id),'confirm'=>'Are you sure you want to delete this item?')),
);
?>

<h1>Update Item Quotation No. <?php echo $model->quotation_no; ?></h1>

<?php $this->renderPartial('_form', array('model'=>$model,'quo_no'=>$quo_no,'unit_sell'=>$unit_sell,'total'=>$total)); ?>